package com.ruoyi.ihome.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ihome.mapper.SysIntegralMapper;
import com.ruoyi.ihome.domain.SysIntegral;
import com.ruoyi.ihome.service.ISysIntegralService;

import javax.annotation.Resource;

/**
 * 信誉积分Service业务层处理
 *
 * @author mage
 * @date 2024-08-16
 */
@Service
public class SysIntegralServiceImpl implements ISysIntegralService
{
    @Resource
    private SysIntegralMapper sysIntegralMapper;

    /**
     * 查询信誉积分
     *
     * @param id 信誉积分主键
     * @return 信誉积分
     */
    @Override
    public SysIntegral selectSysIntegralById(Long id) {
        return sysIntegralMapper.selectSysIntegralById(id);
    }

    @Override
    public SysIntegral selectSysIntegralByUserId(Long id) {
        return sysIntegralMapper.selectSysIntegralByUserId(id);
    }

    /**
     * 查询信誉积分列表
     *
     * @param sysIntegral 信誉积分
     * @return 信誉积分
     */
    @Override
    public List<SysIntegral> selectSysIntegralList(SysIntegral sysIntegral) {
        return sysIntegralMapper.selectSysIntegralList(sysIntegral);
    }

    @Override
    public List<SysIntegral> selectUserIntegral(SysIntegral sysIntegral) {
        return sysIntegralMapper.selectUserIntegral(sysIntegral);
    }

    /**
     * 新增信誉积分
     *
     * @param sysIntegral 信誉积分
     * @return 结果
     */
    @Override
    public int insertSysIntegral(SysIntegral sysIntegral) {
        return sysIntegralMapper.insertSysIntegral(sysIntegral);
    }

    /**
     * 修改信誉积分
     *
     * @param sysIntegral 信誉积分
     * @return 结果
     */
    @Override
    public int updateSysIntegral(SysIntegral sysIntegral) {
        int num = sysIntegralMapper.updateSysIntegral(sysIntegral);
        return num;
    }

    /**
     * 批量删除信誉积分
     *
     * @param ids 需要删除的信誉积分主键
     * @return 结果
     */
    @Override
    public int deleteSysIntegralByIds(Long[] ids) {
        return sysIntegralMapper.deleteSysIntegralByIds(ids);
    }

    /**
     * 删除信誉积分信息
     *
     * @param id 信誉积分主键
     * @return 结果
     */
    @Override
    public int deleteSysIntegralById(Long id) {
        return sysIntegralMapper.deleteSysIntegralById(id);
    }
}
